Skip to content

fix: lag ratio guards only engage when churn latency is actually slow#80

Merged
arzafran merged 1 commit into
mainfrom
fix/lag-ratio-guard-floor
Jul 8, 2026
Merged

fix: lag ratio guards only engage when churn latency is actually slow#80
arzafran merged 1 commit into
mainfrom
fix/lag-ratio-guard-floor

Conversation

@arzafran

@arzafran arzafran commented Jul 8, 2026

Copy link
Copy Markdown
Member

What this does

Stops the tests-build-and-lag job failing on runs whose typing latency is objectively excellent. Six unrelated PRs today failed on ratio blowups where churn p95 was 13–28ms against a 35ms cap — fast baselines make the ratio explode on a few ms of runner jitter.

Summary

  • Ratio checks (p95 1.70x / avg 1.70x) now also require the churn result to be slow enough for a ratio to be meaningful: churn p95 ≥ 20ms / avg ≥ 14ms (env-tunable, PROGRAMA_LAG_MIN_CHURN_*_MS_FOR_RATIO)
  • The delta caps (+20ms/+12ms) and absolute cap (35ms) are untouched — a genuine regression on a fast baseline still fails via deltas (3x from a 7ms baseline = +14ms p95… a 4x = +21ms trips it; and any churn above 20ms re-enables the ratio check)
  • Of today's six flakes, five would have been skipped by this gate; the sixth (churn 27.6ms) still enforces — correctly, as the only genuinely slow run

Test Plan

  • python syntax
  • tests-build-and-lag on this PR

The p95/avg ratio caps fired repeatedly today on runs whose absolute
latency was excellent (churn p95 of 13-17ms against a 35ms cap) because
a fast baseline (~6-8ms) makes the ratio hypersensitive to a few ms of
runner jitter. Six unrelated PRs burned manual re-runs on this.

Ratio enforcement now additionally requires the churn result itself to
be slow (p95 >= 20ms, avg >= 14ms by default, env-tunable). Real
regressions on fast baselines remain caught by the untouched delta caps
(+20ms p95 / +12ms avg) and absolute cap (35ms p95): a genuine 3x
regression from a 7ms baseline blows the delta cap regardless.
@arzafran arzafran merged commit de32f60 into main Jul 8, 2026
8 checks passed
@arzafran arzafran deleted the fix/lag-ratio-guard-floor branch July 8, 2026 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant